USE [GradingSystemDb]

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Users] (
	[UserId] [int] IDENTITY(1,1) NOT NULL,
	[EmployeeId] [int] NOT NULL,
	[Username] [nvarchar](max) NOT NULL,
	[Password] [nvarchar](max) NOT NULL,
	[CreatedBy] [int] NOT NULL,
	[CreatedDttm] [datetime] NOT NULL,
	[ModifiedBy] [int] NOT NULL,
	[ModifiedDttm] [datetime] NOT NULL,
	CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED (
		[UserId] ASC
	)
	WITH (
		PAD_INDEX=OFF, 
		STATISTICS_NORECOMPUTE=OFF, 
		IGNORE_DUP_KEY=OFF, 
		ALLOW_ROW_LOCKS=ON, 
		ALLOW_PAGE_LOCKS=ON
	) 
	ON [PRIMARY]
) 
ON [PRIMARY]

GO
ALTER TABLE	[dbo].[Users] WITH CHECK ADD CONSTRAINT [FK_Employees_EmployeeId_Users_EmployeeId] FOREIGN KEY([EmployeeId])
REFERENCES  [dbo].[Employees] ([EmployeeId])
GO
ALTER TABLE [dbo].[Users] CHECK CONSTRAINT [FK_Employees_EmployeeId_Users_EmployeeId]


